import { FC } from "react";

import { Typography } from "antd";
const { Title, Paragraph } = Typography;
export type questionInfo_propsType = {
  title?: string;
  text?: string;

  islock?: boolean;
  onchange?: (newprps: questionInfo_propsType) => void;
};

export const questionInfo_defaultValue: questionInfo_propsType = {
  title: "问卷标题",
  text: "问卷描述",
};
const QuestionInfo: FC<questionInfo_propsType> = (props) => {
  const { title, text } = { ...questionInfo_defaultValue, ...props };
  const textList = text?.split('\n')
  return (
    <>
      <Title style={{ margin: 0 ,textAlign:'center' }}>{title}</Title>
      <Paragraph style={{ margin: 0,textAlign:'center' }}>{
        textList?.map((item,index)=>{
            return <span key={index}>
                {index > 0 ? <br/> : null}
                {item}
            </span>
        })
      }</Paragraph>
    </>
  );
};

export default QuestionInfo;
